﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/admin.master" AutoEventWireup="true" CodeFile="Add_Edit.aspx.cs" Inherits="admin_Menu_Add_Edit" %>

<%@ Register TagName="MenuDialog" TagPrefix="uc" Src="~/admin/Dialog/MenuDialog.ascx" %>
<%@ Import Namespace="DalatCooking.Core.Helper" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <script type="text/javascript">
        $(document).ready(function () {
            $(".url").colorbox({ width: "650px", height: "600px", inline: true, href: "#menutype" });
            $('#tabs').tabs();
        });

        function closeOverlay() {
            $.colorbox.close();
        }
        function insertUrl(url) {
            $("[id$='txtUrl']").val(url);
            closeOverlay();
        }
        function insertMenuType(url) {

            $("#catalog").toggle("slow");

        }


    </script>
    <div class="content-box-outer">
        <div class="content-box-right">
            <ul>
                <li class="content-box-selected"><a href="Add_Edit.aspx" class="new">Thêm</a></li>
                <li><a href="Default.aspx">Menu</a></li>
                <li><a href="Group.aspx">Nhóm</a></li>
            </ul>
        </div>
        <div class="content-box-left">
            <h1>Thêm / Cập nhật Menu
             Menu <a href="Add_Edit.aspx" class="addNew">Thêm chi tiết</a>
                </h1>
            <table class="tblForm largeForm" style="width: 100%; margin: 0;">
                <tr>
                    <td style="vertical-align: top; padding: 0 40px 0 0;">
                        <ul class="fl">
                            <li>
                                <label class="lbl" for="<%=txtName.ClientID %>">
                                    Tên</label>
                                <asp:TextBox runat="server" ID="txtName" Width="400" />
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtName"
                                    Display="Dynamic" ErrorMessage="Nhập tên Menu" />
                            </li>
                            <li>
                                <label class="lbl" for="<%=txtUrl.ClientID %>">
                                    Liên kết (Url)</label>
                                <asp:TextBox runat="server" ID="txtUrl" TabIndex="9" Width="400" />
                                <a href="#" class="url">Url</a> </li>
                            <li>
                                <label class="lbl" for="<%=txtIconUrl.ClientID %>">
                                    Icon</label>
                                <asp:TextBox runat="server" ID="txtIconUrl" TabIndex="9" Width="400" />
                            </li>
                            <li>
                                <label class="lbl" for="<%=txtSortIndex.ClientID %>">
                                    Sắp xếp</label>
                                <asp:TextBox runat="server" ID="txtSortIndex" Width="200" />
                            </li>
                            <li>
                                <label class="lbl">
                                    Tùy chọn</label>
                                <asp:CheckBox runat="server" ID="cbFrontPage" Text="Trang chủ" /><br />
                            </li>
                            <li>
                                <asp:CheckBox runat="server" ID="cbShowInList" Text="Hiển thị"
                                    Checked="true" />
                            </li>
                            <li>
                                <asp:CheckBox runat="server" ID="cbIsActive" Checked="true" Text="Kích hoạt" />
                            </li>
                        </ul>
                    </td>
                    <td class="secondaryForm" style="padding: 0; vertical-align: top;">
                        <ul class="fl">
                            <li>
                                <label class="lbl" for="<%=ddlGroup.ClientID %>">
                                    Nhóm menu</label>
                                <asp:DropDownList runat="server" ID="ddlGroup" Width="250" AppendDataBoundItems="true">
                                    <asp:ListItem Value="2">none</asp:ListItem>
                                </asp:DropDownList>
                            </li>
                            <li>
                                <div style="">
                                    <label class="lbl" for="<%=txtCategory.ClientID %>" style="margin-bottom: 5px; display: block;">
                                        Thêm nhanh Nhóm menu</label>
                                    <asp:TextBox runat="server" ID="txtCategory" ValidationGroup="category" Width="150" />
                                    <asp:Button runat="server" ID="btnCategory" Text="Thêm" ValidationGroup="category"
                                        CssClass="btn" Style="min-width: 0px; margin: 0;" OnClick="btnCategory_Click" />
                                    <asp:CustomValidator runat="Server" ID="valExist" ValidationGroup="category" ControlToValidate="txtCategory"
                                        ErrorMessage="Chuyên mục đã tồn tại" Display="dynamic" />
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtCategory"
                                        ErrorMessage="Được yêu cầu" ValidationGroup="category" Display="Dynamic" />
                                </div>
                            </li>
                            <li>
                                <label class="lbl" for="<%=ddlMenuParent.ClientID %>">
                                    Menu cha</label>
                                <asp:DropDownList runat="server" ID="ddlMenuParent" Width="250" AppendDataBoundItems="true">
                                    <asp:ListItem Value="0">none</asp:ListItem>
                                </asp:DropDownList>
                            </li>
                            <li>
                                <label class="lbl" for="<%=txtKeyword.ClientID %>">
                                    Mô tả</label>
                                <asp:TextBox runat="server" ID="txtKeyword" TextMode="MultiLine" Rows="5" />
                            </li>

                        </ul>
                    </td>
                </tr>
            </table>
            <div class="action_buttons">
                <asp:Button ID="btnSave" Text="Lưu" CssClass="btn primary"
                    runat="server" OnClick="btnSave_Click" />
                hoặc
                <% if (!string.IsNullOrEmpty(Request.QueryString["MenuID"]))
                   { %>
                <a href="Default.aspx" title="Go to page">Quay lại</a>
                <%}
                   else
                   {%>
                <a href="Default.aspx" title="Cancel">Hủy</a>
                <%} %>
            </div>
        </div>
    </div>
    <div style="display: none">
        <uc:MenuDialog ID="menuDlg" runat="server" />

    </div>
</asp:Content>

